package org.eruta;

import java.awt.Image;
import java.util.ArrayList;    

/**Class tro model the behaviour of a tile. A tile can be animated, 
 * but only in a simple loop-like way.. *
 */

public class Tile {
    
    ArrayList<Image>  _images;
    int     _image_now;
    int     _image_max;   
    int     _delay;
    int     _animation_type;
    
    Tile(int max, int delay, int animation_type) {
        _image_max      = max;
        _images         = new ArrayList<Image>(_image_max);        
        _image_now      = 0;
        _delay          = delay;
    }
    
    public Image get() {
        return _images.get(_image_now);
    }
    
    public void animate() {
        _image_now ++;
        if(_image_now > _image_max) {
            // loop style animation.
            _image_now = 0;
        }
    }
    
    public boolean set(int phase, int tile_index) {
        
        return true;
    }
    
}